<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
    .inner {
        height: 200px;
        border: 2px solid #000;
    }
    #banner {
        position: absolute;
        left: 0;
        top: 0;
        width: 200px;
        height: 200px;
        background: #000;
        font: 20px/50px "宋体";
        color:#fff;
    }
</style>
<script>
window.onload = function(){
    let banner = document.querySelector("#banner");
    let resizeBanner = ()=>{
        let l = (window.innerWidth - banner.offsetWidth)/2;
        let t = (window.innerHeight - banner.offsetHeight)/2;
        banner.style.left = l + "px";
        banner.style.top = t + "px";
    };
    resizeBanner();
};
</script>
</head>
<body>
   <div id="banner">广告弹窗</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div>
   <div class="inner">页面内容</div> 
</body>
</html>